import { apiRequest } from '@/utils/request'
import type { ICarResponse } from '@/types/apis/car'

/**
 * 获取车辆列表
 */
export function carListApi(params: { pageNum: number; pageSize: number }) {
  return apiRequest<{ list: ICarResponse[]; total: number }>({
    method: 'get',
    url: '/mock/car',
    params,
  })
}

/**
 * 获取指定车辆信息
 */
export function carByIdApi(id: string | number) {
  return apiRequest<ICarResponse>({
    method: 'get',
    url: `/mock/car/${id}`,
  })
}
